package com.kotasoft.iip.processor;

import java.util.Calendar;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.kotasoft.iip.model.insurance.Order;
import com.kotasoft.iip.model.interfaces.HasOrder;

public class ProcessOrder implements Processor {

	private static final Logger LOG = LoggerFactory.getLogger(ProcessOrder.class);

	public void process(Exchange exchange) throws Exception {
		Order order = exchange.getIn().getMandatoryBody(HasOrder.class).getOrder();
		LOG.debug("Procesando orden {}", order);
		order.setProcessed(Calendar.getInstance().getTime());
	}
}
